#include<iostream>
using namespace std;

int main()
{
    unsigned long long n = 0, sum = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        long long r = 1;
        for (int j = 1; j <= i; j++)
        {
            r *= j;
        }
        sum += r;
    }
    cout << sum << endl;
    return 0;
}